1. Field of the Invention
The present invention relates to an image conversion method and apparatus for compressing the dynamic range of brightness of an image in which each pixel has a luminance value representing the density thereof. Note that in the present specification, the expression “spatial frequency” of luminance of a two-dimensional image encompasses the single-dimensional luminance frequency for each line (for each row or each column).
The present invention also relates to a noise detection method for detecting noise contained in an original signal and to an image processing apparatus utilizing the method. In particular, the present invention relates a noise detection method in which a plurality of local regions are provided in an original signal, and the noise level is detected on the basis of variation in luminance of unsaturated local regions, as well as to an image processing apparatus utilizing the method.
2. Description of the Related Art
When an image having both shady and sunny regions; i.e., an image having great contrast, is captured and displayed on a display unit having a narrow dynamic range of brightness, a dark portion of the image is displayed as a solid black region and a bright portion is displayed as a solid white region, thereby rendering an object or the like within the image difficult to discern. When gray-scale modification is performed in such a manner that a large number of gray-scale steps are imparted to a specific luminance range such as a bright range or a dark range, contrast can be increased within the specific luminance range. However, there arises a problem in that contrasts in the remaining luminance ranges decrease. In order to solve such a problem, a method of compressing the dynamic range of an image, called Homomorphic Filtering, has been employed. In Homomorphic Filtering, data regarding illumination strength, such as difference between shady and sunny regions and variation in illumination, are suppressed through removal or suppression of a low spatial frequency component of luminance, to thereby facilitate discernment of an object or the like within both shady and sunny regions of an image. FIGS. 18A and 18B illustrate the concept of Homomorphic Filtering. In FIG. 18A, luminances of pixels of a single image are subjected to logarithmic modification (log; 91) and are then passed through a high-pass filter (HPF; 92) in order to obtain image data consisting of high spatial frequency components, which are then subjected to inverse logarithmic modification (log−1; 93). In FIG. 18B, luminances of pixels of a single image are subjected to logarithmic modification (log; 91) and are then passed through a low-pass filter (LPF; 94) in order to obtain image data consisting of low spatial frequency components. After reversals of their signs, the thus-obtained image data are fed to an adder 95 and are added to image data obtained through the logarithmic modification (log; 91) but are not passed through the low pass filter; and the resultant image data are subjected to inverse logarithmic modification (log−1; 93).
In Homomorphic Filtering, the “low spatial frequency component” is suppressed uniformly. Therefore, when Homomorphic Filtering is applied to an image obtained through photographing a large white object (or a surface thereof), the object is displayed on the screen in the form of a large gray area. For example, when Homomorphic Filtering is applied to an image including a traffic control measure on a road, such as a lane mark or a pedestrian crossing, the traffic control measure is displayed as a grayish image, which in some cases is extremely difficult to recognize. Such a phenomenon occurs because a white object having low frequency component of luminance variation becomes dark relative to a white object having high frequency component of luminance, due to suppression of the low spatial frequency component. In the case of employment of a simplified method of suppressing a low spatial frequency component as measured along a single direction such as a vertical direction or a horizontal direction, the above-described problem becomes remarkable. For example, when an image containing a vertical white lane mark and a horizontal white lane mark is subjected to frequency analysis along the horizontal direction, only the horizontal white line is grayed. This image conversion process provides an image that imparts an extremely unnatural impression. For the same reason, a low frequency component of low luminance may become brighter in some cases; however, this provides an unnatural impression to a lower degree as compared to the case of a white object being displayed as a gray object. Moreover, uniform suppression of the low frequency component produces an image in which noise is conspicuous in portions of low luminance. This is because high frequency components are enhanced uniformly and relatively even in low luminance portions at which the S/N ratio of the captured image is low. When an image having a compressed dynamic range is displayed with a high average luminance, low luminance portions are displayed brighter, so that noise becomes more conspicuous in the displayed image.
In view of the foregoing, Japanese Patent Nos. 1530832, 2509503, and 2663189 propose methods for use in, for example, medical image capturing apparatuses. Japanese Patent No. 1530832 discloses an image sharpening method which increases the degree of enhancement of high frequency components in accordance with density of an image. Specifically, a reproduction image S′ is obtained by the expression S′=Sorg+β(Sorg+Sus), where Sorg is an original image, Sus is a low frequency image, and β is an enhancement coefficient. The enhancement coefficient β is increased monotonously in accordance with the density of the original image or the low frequency image in order to prevent enhancement of noise. Although the sharpening method can suppress enhancement of noise, the method cannot reduce noise to a level lower than that of the original image. Moreover, the sharpening method cannot compress a dynamic range. Japanese Patent No. 2509503 discloses a method in which correction data for dynamic range compression are generated by use of a low spatial frequency component of an original signal, and the dynamic range of the original signal is compressed by use of the correction data. The correction data for dynamic range compression are obtained through comparison between a reference value and signal values obtained from an original signal. When a signal value is not less than the reference value, a constant value is output as correction data. When the signal value is less than the reference value, the correction data are obtained on the basis of the low spatial frequency component. That is, one of a bright portion and a dark portion of an image is not corrected, and the other portion is subjected to dynamic range compression. This method can prevent a white large object from being grayed, by compressing the dynamic range in a dark portion of the image only and not compressing the dynamic range in a bright portion of the image. However, the method cannot suppress noise in low luminance portions. Moreover, since the frequency characteristics change abruptly at the boundary between a bright portion and a dark portion, a pseudo-contour is generated. Japanese Patent No. 2663189 discloses a method in which a low frequency image is obtained by averaging original signals of pixels within a predetermined area in the vicinity of each pixel of an original image, and the original image is processed on the basis of the low frequency image. Specifically, the luminance of a low frequency image at each pixel is used as an argument of a monotonic decreasing function; and the output of the function is added to the density of the corresponding pixel of the original image to thereby compress the dynamic range. This method enables compression to be effected only within a desired brightness range; e.g., a bright portion or a dark portion, through setting the characteristics of the monotonic decreasing function. Generation of a pseudo-contour can be prevented by making the derivative of the monotonic decreasing function continuous. However, since the original image component is added uniformly, noise cannot be suppressed in low luminance portions.
Moreover, Japanese Patent Application Laid-Open (kokai) No. 6-51009 discloses a conventional noise measurement method and apparatus for measuring noise in an original signal. In this method, a plurality of blocks are provided in an image (FIG. 27A); an activity value A of each block is calculated; and a noise level is determined on the basis of the activity value A. The activity value A represents the degree of variation of luminance in the corresponding block and is a variance used in statistical processing. As shown in FIG. 27B, the histogram of the activity values A of all the blocks is obtained; and an activity value A at a point corresponding to K % (K=1 to 10) as calculated from the side of the lowest frequency is obtained and output as a noise value N.
Moreover, as shown in FIG. 28, by means of a comparison circuit 3, an activity value A periodically calculated by an activity-value calculation circuit 1 is compared with a noise value N stored in an accumulation circuit 2. When A<N, a first correction value is added to the noise value N, and when A>N, a second correction value, which is 10 to 100 times the first correction value, is subtracted from the noise value N, to thereby update the noise value N on a block-by-block basis. This update is repeated in order to converge the noise value N to a desired value, whereby the noise value N is obtained without obtaining the histogram.
Japanese Patent Application Laid-Open (kokai) No. 7-30786 discloses a method for measuring a noise component of a original signal, and a circuit for carrying out the method. In this method, an original signal is delayed by means of a delay circuit; and the difference between the original signal and the delayed signal is obtained in order to produce a differential absolute-value signal, to thereby detect noise stemming from fluctuation of the signal with time. Specifically, a search window serving as a block is set for the differential absolute-value signal; the maximum peak value is detected within the search window; and the minimum value among the peaks values within a plurality of search windows is obtained as a noise level.
Japanese Patent Application Laid-Open (kokai) No. 8-201464 discloses a method of detecting the S/N value of a television signal. In this method, an input original signal is divided into a plurality of blocks on an image; and in each block, differences between the original signal and a temporally averaged signal and between the original signal and a spatially averaged signal are obtained for each pixel. Subsequently, the distribution of the differential values within the block and the statistical distribution of noise values are compared for significance judgment; and the generation frequencies of differential values of blocks having been judged to be significant within the entire image are obtained. The S/N value of the original signal is detected from the distribution of the generation frequencies.
However, the noise measurement method and apparatus disclosed in Japanese Patent Application Laid-Open No. 6-51009 employs as a noise value N an activity value at a K % point of the histogram of activity values A of all blocks within an image. Therefore, a problem arises in that the estimated noise value greatly depends on the characteristics of the original image (noise free). Specifically, when a large portion of the original image is saturated, the number of blocks having small activity values increases, whereby the noise value, which is a K % point activity value, decreases. By contrast, when a small portion of the original image is saturated, the number of blocks having large activity values increases, whereby the noise value, which is a K % point activity value, increases. Moreover, when the original image contains much amount of high frequency components throughout the entire image, the number of blocks having large activity values increases, whereby the noise value, which is a K % point activity value, increases. By contrast, when the original image contains much amount of low frequency components throughout the entire image, the number of blocks having small activity values increases, whereby the noise value, which is a K % point activity value, decreases.
Moreover, in the method, on the basis of results of comparison between the estimated noise value and an activity value of a new block, a first correction value is added to the estimated noise value, or a second correct value is subtracted from the estimated noise value; and this step is repeated in order to converge the noise value to an appropriate value. However, the converged results of the noise value depend on the magnitudes of the first and second correct values relative to the noise level. Specifically, when the first and second correct values are relatively large as compared with the noise value N, variation in the converged value is large, although the noise value N converges through relatively few iterations of comparison. By contrast, when the first and second correct values are relatively small as compared with the noise value N, the number of iterations of comparison required for convergence increases, although variation in the converged value is small. That is, in some cases, the noise value N does not converge even after comparison is performed for all blocks within the image. Therefore, the method has a drawback in that a rough value of the noise value N must be known in order to properly determine the first and second correction values and to converge the noise value without fail.
In the method and circuit for measuring a noise component of an original signal disclosed in Japanese Patent Application Laid-Open No. 7-30786, the maximum value within a search window of a differential absolute-value signal between an original signal and its delay signal represents the peak of a noise component of the input image when no motion is present within the search window and represents the peak of the sum of a motion component and a noise component when a motion is present within the search window. Specifically, in a plurality of search windows, the minimum value among the maximum values of the search windows is detected to thereby detect the peak value of the noise component that does not contain any motion component. Therefore, the method and circuit premise that an image does not move in any of the plurality of search windows. However, in the case of an image captured by use of a moving camera such as a camera mounted on a vehicle, all the peak values detected in the search windows contain motion components, because motion occurs over the entire image. In other words, the method has a drawback in that when noise of an image captured by use of a moving camera is measured, the level of noise is detected to be greater than the actual level.
In the method of detecting the S/N value of a television signal disclosed in Japanese Patent Application Laid-Open No. 8-201464, in each block of an input original signal, differences between the original signal and a temporally averaged signal and differences between the original signal and a spatially averaged signal are obtained for each pixel; and the distribution of the differential values and the known statistical distribution of noise values are compared for significance judgment. In other words, the presence/absence of a motion within each block is judged from the distribution of the differences between the input original signal and the temporally averaged value thereof; and the presence/absence of a variation component (edge) of the image within each block is judged from the distribution of the differences between the input original signal and the spatially averaged value thereof. This method has a drawback of high calculation cost, because judgment of significance is performed in each block through comparison with the statistical distribution of noise values.